import { Injectable } from '@angular/core';
import { HttpserviceProvider } from '../httpservice/httpservice';

/*
  Generated class for the BusiserviceProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class BusiserviceProvider {

  constructor(private httpservice: HttpserviceProvider) {
    console.log('Hello BusiserviceProvider Provider');
  }

  login(username, password) {
    return this.httpservice.post("/login/login?username=" + username + "&password=" + password+"&type="+1);
  }
  changePassword(newpassword,oldpassword){
    return this.httpservice.post("/order/changePassword?password="+newpassword+"&oldpassword="+oldpassword);
  }
  getWjOrder(){
    return this.httpservice.post("/order/getWjOrder");
  }
  getBusiYjOrder(){
    return this.httpservice.post("/order/getBusiYjOrder");
  }
  jd(orderid){
    return this.httpservice.post("/order/JieDan?orderid="+orderid);
  }
  completeOrder(orderid){
    return this.httpservice.post("/order/completeOrder?orderid="+orderid);
  }
  orderDetail(orderid){
    return this.httpservice.post("/order/orderDetail?orderid="+orderid);
  }
  regi(user){
    return this.httpservice.post("/login/regi",user);
  }
  getProdList(){
    return this.httpservice.post("/order/getProdList");
  }
  addProd(name,price,des,base64data){
    return this.httpservice.post("/order/prodAdd?name="+name+"&price="+price+"&des="+des,base64data);
  }
}
